package com.neuedu.first;

import java.util.Comparator;

public class MonitorComparator implements Comparator<Monitor> {
    @Override
    public int compare(Monitor o1, Monitor o2) {
        //默认返回值
        int iVal=0;
        if (o1 !=null&&o2 !=null){
            //比较o1o2大小
            if (o1.getStuScore()>o2.getStuScore()){
                iVal=1;
            }else if (o1.getStuScore()<o2.getStuScore()){
                iVal=-1;
            }
        }
        return iVal;
    }
}
